#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
//杨辉三角
/*int main()
{
	int arr[10][10] = { 0 };
	for (int i = 0;i < 10;i++)
	{
		arr[i][0] = 1;
		for (int j = 0; j <= i; j++)
		{
		    if (i >= 1 && j >= 1)
			{
				arr[i][j] = arr[i - 1][j - 1] + arr[i - 1][j];
			}
			printf("%-4d", arr[i][j]);
		}
		printf("\n");
	}
	printf("凌祖琪上机打卡");
	return 0;
}*/


//猜数字游戏
//int main()
//{
//	int a[9];
//	int sum = 0;
//	for (int i = 0; i < 10; i++)
//	{
//		scanf("%d",&a[i]);
//		sum += a[i];
//	}
//	int average = sum / 10;
//	printf("%d", average);
//	return 0;
//}
/*void menu()
{
	printf("****************\n");
	printf("****************\n");
	printf("****1、play*****\n");
	printf("****0、exit*****\n");
	printf("****************\n");
	printf("****************\n");
}
void game()
{
	int r = rand() % 100 + 1;
	int guess = 0;
	int count = 5;
	while (count)
	{
		printf("你还有%d次机会\n", count);
		printf("请猜数字:>");
		scanf("%d",&guess);
		if (guess < r)
			printf("猜小了\n");
		else if (guess > r)
			printf("猜大了\n");
		else
		{
			printf("恭喜你，猜对了\n");
			break;
		}
		count--;
	}
	if (count == 0)
		printf("你失败了，正确值是%d\n", r);
}

int main()
{
	
	int input = 0;
	srand((unsigned int)time(NULL));
	do
	{
		menu();
		scanf("%d", &input);
		switch (input)
		{
		case 1:
			game();
			break;
		case 0:
			printf("退出游戏\n");
			break;
		default:
			printf("输入错误，请重新输入");
			break;
		}
	} 
	while (input);
	return 0;
}*/